<?php

namespace Home\Biz;

class StringBiz {
	public static function getSkuChannelRevenueStatusText($source) {
		switch ($source) {
			case 1 :
				return '淘宝';
				break;
			case 2 :
				return '京东';
				break;
			case 3 :
				return '官网';
				break;
			case 5 :
				return '英雄会O2O';
				break;
			case 6 :
				return '村淘';
				break;
			case 8 :
				return '大客户';
				break;
			default :
				return strval ( $source );
		}
	}
	
	
	public static function getSkuStatusRevenueStatusText($source) {
		switch ($source) {
			case 0 :
				return '无效';
				break;
			case 1 :
				return '有效';
				break;
			
			default :
				return strval ( $source );
		}
	}
	
	
	
	
	public static function  checkAmount($amount){
		
		
		//if(preg_match("/^(0|([1-9][0-9]{0,9}))(.[0-9]{1,3})?$/", $amount)){
		
		
		   if(preg_match("/^(?!0+(?:\.0+)?$)(?:[1-9]\d*|0)(?:\.\d{1,3})?$/", $amount)){
			//if(preg_match("/^(([1-9][0-9]*)|(([0](\.\d{1,3}))?|[1-9][0-9]*\.\d{1,2})))$", $amount)){
					
			return True;
		}else{
			
			return FALSE;
		}
		
		
	}
	
}